<?php
/**
 * Test MySQL from this local machine
 * 
 * @author David Christian Liedle <david.liedle@gmail.com>
 * @link   http://nmox.org/
 *
 */

require_once("../main/nmox.php");
#
# Test the Database class:
#
$myDB = new Database;
$myDB->connect();
$myDB->add_query("Describe users", "DESCRIBE users");
$myDB->do_query("Describe users");
oneshot($myDB->results["Describe users"]." :) ");
$myDB->load_array("Describe users");
$myArray = $myDB->get_array("Describe users");
$myDB->free_results();
$myDB->close();
#
# Display:

// create a table to view this data...

foreach( $myArray as $key=>$value ){
    if( is_array($value) ){
        foreach( $value as $k=>$v ){
            oneshot($k.": ".$v." !!! ");
        }
    } else {
        oneshot($key.": ".$value." !!! ");
    }
}
#
# all done!
#
echo xP("done!");
oneshot("This file is /nmox/local/mysql.php");
